// 101.对称二叉树
package LeetcodeHot100;


public class Solution101 {
    public boolean isSymmetric(TreeNode root) {
        if (root == null) {
            return true;
        }
        return isSame(root.left, root.right);
    }

    public boolean isSame(TreeNode left, TreeNode right) {
        if (left == null && right == null)
            return true;
        else if ((left == null && right != null) || (left != null && right == null))
            return false;
        else
            return (left.val == right.val) & isSame(left.left, right.right) & isSame(left.right, right.left);
    }
}
